Dynomotion

Group: DynoMotion Message: 5360 From: frank_19_88 Date: 6/28/2012
Subject: mach3 turn spindle control
Hi TK,

At the moment I have retrofitted 2 Maho milling machine's with success.(Last time I told you the machine stopped exact half way of an circle, when I did re installed windows xp the problem was fixed!

Now I did try to retrofit an weiler 120 turning machine. Most things work exact the same as with the milling machine.
But I don't really understand how to programmed the spindle speed.

I programmed the code below. (The spindle axis is programmed at axis 2 in the int.c as dac2 output and encoder input 3 A+/- B+/-)

If I type m3 s100 within mach3 turn the spindle start turning exact 100 rpm. But I don't receive any feed back of my actual spindle speed. So I can not use the 'calibrate spindle' within mach3 turn. And if I change F50 it start turning at 100%.

I programmed the mach3 plug-in to : sensor type 1, encoder axis 2, counts/rev 2000.

Any idea's?

With kind regards,

Frank

#include "KMotionDef.h"

//Plugin Notifications and defines..
enum { EX_DDA , EX_VMS, EX_COMMAND, EX_SPINON, EX_SPINOFF, EX_SPINSPEED, EX_MOTORTUNED
, EX_SETUP, EX_FEEDHOLD, EX_RUN, EX_ESTOP , EX_CONFIG };

main()
{
int message = persist.UserData[0]; // Mach3 message ID
int Direction = persist.UserData[1]; // Mach3 Spindle Direction
float speed = *(float *)&persist.UserData[2]; // value stored is actually a float
printf("Mach3 Notify Message=%d, Direction=%2d, Spindle Set to %f\n",message,Direction,speed);

switch (message)
{
case EX_SPINSPEED:
printf("Spindle Speed Set to %f\n",speed);
if (ReadBit(sp_cw)==1)
{
Jog(S,speed*FACTOR);
}
else if (ReadBit(sp_ccw)==1)
{
Jog(S,speed*FACTOR*-1);
}
break;
}
}
Group: DynoMotion Message: 5361 From: Echo Zhao Date: 6/29/2012
Subject: Re: mach3 turn spindle control
Hello friends,
 
I know you have machine like milling,grinding or lathe,we can suply defferent lathe and resolution linear scale and DRO.
 
pls kindly check the catalogue on your attachment.
 
if you have any question on it,pls let me know,My email:echo@...
 
 
Best regards,
echo

Group: DynoMotion Message: 5380 From: Tom Kerekes Date: 6/30/2012
Subject: Re: mach3 turn spindle control
Hi Frank,
 
I don't know why the spindle speed wouldn't be reported.  IS the encoder working?  Is the spindle position changing on the Axis Screen as #2 position?
 
Regards
TK